package com.jjkj.environmental.environmental.utils

import android.content.Context
import android.widget.Toast


/**
 * @author Administrator
 * @date 2018/3/21
 */
object ToastUtils {

    @Volatile
    private var mToast: Toast? = null

    fun showToast(context: Context, info: String) {
        if (mToast != null) {
            mToast!!.cancel()
            mToast = Toast.makeText(context, info, Toast.LENGTH_SHORT)
            mToast!!.show()
        } else {
            mToast = Toast.makeText(context, info, Toast.LENGTH_SHORT)
            mToast!!.show()
        }
    }
}
